package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.databinding.DataBindingUtil;

import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.example.myapplication.databinding.ActivityMainBinding;

import java.io.IOException;
import java.io.InputStream;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private ActivityMainBinding mainBinding;
    MediaPlayHelper helper;
    AudioReader audioReader;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        mainBinding.btnOpen.setOnClickListener(this);
        mainBinding.btnClose.setOnClickListener(this);
//        helper = new MediaPlayHelper(mainBinding.surfaceHold, this);
        audioReader = new AudioReader();
        audioReader.init();
        G726Util.init();
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_open:
                if (null != helper) {
//                    helper.startConnect();
                }
                break;
            case R.id.btn_close:
//                helper.closeConnect();
                startActivity(VideoActivity.createIntent(this));
                break;

        }
    }

}
